<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2016/8/5
 * Time: 16:53
 */
namespace App\Models;

use Zizaco\Entrust\EntrustRole;

class Role extends EntrustRole
{
    /**
     * 属于该身份的用户。
     */
    public function users()
    {
        return $this->belongsToMany('App\Models\User','role_user','role_id', 'user_id');
    }

    /**
     * 属于该身份的权限。
     */
    public function permissions()
    {
        return $this->belongsToMany('App\Models\Permission','permission_role','role_id','permission_id');
    }

}